# docker build -t protobuf-builder . #如果 Dockerfile 有改动才执行
docker run -it --rm \
    --volume=${PWD}:${PWD}/ \
    --workdir=${PWD} \
    protobuf-builder:latest \
    /bin/sh build.sh

echo "拷贝生成的文件到对应目录"
JS_TARGET_DIR=../g-server/frontend/src/libs/protobuf
JAVA_TARGET_DIR=../g-server/common/src/main/java
rm -rf $JAVA_TARGET_DIR/cn/owng/protobuf
cp -r ./target/java/src/main/java/* $JAVA_TARGET_DIR
rm -rf $JS_TARGET_DIR
mkdir -p $JS_TARGET_DIR
cp -r ./target/js $JS_TARGET_DIR
echo "完成全部操作"